<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<!DOCTYPE html>
<html>
 <head>
  <title>采购申请单</title>
  <t:base type="jquery,easyui,tools,DatePicker,yongxin_css,mobile_css"></t:base>
 </head>
  <style type="text/css">

  table th{
  word-break: keep-all;white-space:nowrap;
  }
  
  table td{
  word-break: keep-all;white-space:nowrap;
  }  
  </style>
 <body scroll="no">
 <div id="wrapper">
    <t:formvalid formid="formobj" dialog="true" usePlugin="password" layout="table" action="checkPurchaseController.do?save">
		    <div align="center" style="margin-top: 10px;font-weight:bold"><span style="font-family: Micorosoft;font-size: 20px;">采购申请单</span></div>
		    <br/>
			<table style="width: 80%" align="center"  cellpadding="6" cellspacing="1" class="formtable">
			   <tr>
			     <td>申请部门:</td>
			     <td>
			        <input class="inputxt" value="${checkPurchasePage.fdeptidname}">
				 </td>
			     <td>申请编号:</td>
			     <td>	
			        <input class="inputxt"  value="${checkPurchasePage.fbillno}">
			     </td>
			   </tr>
			   <tr>
			     <td>申请日期:</td>
			     <td>
			      <input class="Wdate" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})"  style="width: 150px" 
							   value="<fmt:formatDate value='${checkPurchasePage.fdate}' type="date" pattern="yyyy-MM-dd"/>"></td>
			     <td>备注:</td>
			     <td>		
			     <input class="inputxt"  value="${checkPurchasePage.fnote}">
				 </td>
			   </tr>
			   			   <tr>
			     <td>申请人:</td>
			     <td>		
			     <input class="inputxt" id="frequesteridname" name="frequesteridname" ignore="ignore"
							  value="${checkPurchasePage.frequesteridname}"></td>
			     <td>制单人:</td>
			     <td>		
			     <input class="inputxt" id="fnote" name="fnote" ignore="ignore"  value="${checkPurchasePage.fbilleridspname}">
			     </td>
			   </tr>
			</table>
			<br/>
			<br/>
			<div>
			   <table style="width: 80%;text-align: center" align="center" cellpadding="6"  align="center" class="formtable" >
			      <tr>
			         <th>行号</th>
			         <th>物料代码</th>
			         <th>物料名称</th>
			         <th>单位</th>
			         <th>数量</th>
			         <th>建议采购日期</th>
			         <th>请购部门</th>
			         <th>提前期</th>
			         <th>到货日期</th>
			         <th>说明</th>
			      </tr>
		          <c:forEach items="${itemList}" var="i" varStatus="status">
		          <tr>
		            <td>${status.index + 1}</td>
		            <td>${i.fitemidnumber}</td>
		            <td>${i.fitemidname}</td>
		            <td>${i.funitidname}</td>
		            <td>${i.fauxqty}</td>
		            <td><fmt:formatDate value='${i.fapurchtime}' type="date" pattern="yyyy-MM-dd"/></td>
		            <td>${i.fentryselfp0125name}</td>
		            <td><fmt:formatDate value='${i.fleadtime}' type="date" pattern="yyyy-MM-dd"/></td>
		            <td><fmt:formatDate value='${i.ffetchtime}' type="date" pattern="yyyy-MM-dd"/></td>
		            <td>${i.fentryselfp0126}</td>
		          </tr>
		          </c:forEach>
			   </table>
			   
			   	<div id="dlg-buttons" style="margin-left: 10%;margin-top: 10px;">
										<a href="#" class="easyui-linkbutton" iconCls="icon-ok" id="check_btn">审批</a>&nbsp;&nbsp;&nbsp;&nbsp;
										<a href="#" class="easyui-linkbutton" iconCls="icon-redo" id="uncheck_btn">驳回</a>
			  </div>
			</div>
	</t:formvalid>
	</div>
 </body>
 
 
 	 <script type="text/javascript">
  
        $("#check_btn").click(function() {
        	ajaxdoForm('purchaseCheckController.do?check&id=${checkPurchasePage.id}','formobj');
        	$("#check_btn").hide();
        	$("#uncheck_btn").hide();
        });
        
        $("#uncheck_btn").click(function() {
        	ajaxdoForm('purchaseCheckController.do?uncheck&id=${checkPurchasePage.id}','formobj');
        	$("#check_btn").hide();
        	$("#uncheck_btn").hide();
        });
  
  
  </script>